package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 开发团队 ：lxh
 * 开发人员 ：李兴洋
 * 开发时间 ：2020年3月9日15:50:51
 * 类的名称 ：CareRecord
 * 类的描述 ：客户关怀
 */
@Entity
@Table(name = "care_record", schema = "lxh_crm", catalog = "")
public class CareRecord {
    private int careRecId;
    private String careTle;
    private Date beginTime;
    private String careCon;
    private String cusBack;
    private String remark;
    private Integer check;

    private CareType careType;
    private Customer customer;
    private Emp emp;

    @ManyToOne
    @JoinColumn(name = "care_type_id")
    public CareType getCareType() {
        return careType;
    }

    public void setCareType(CareType careType) {
        this.careType = careType;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @ManyToOne
    @JoinColumn(name = "emp_id")
    public Emp getEmp() {
        return emp;
    }

    public void setEmp(Emp emp) {
        this.emp = emp;
    }

    @Id
    @Column(name = "care_rec_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getCareRecId() {
        return careRecId;
    }

    public void setCareRecId(int careRecId) {
        this.careRecId = careRecId;
    }

    @Basic
    @Column(name = "care_tle", nullable = true, length = 50)
    public String getCareTle() {
        return careTle;
    }

    public void setCareTle(String careTle) {
        this.careTle = careTle;
    }

    @Basic
    @Column(name = "begin_time", nullable = true)
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Basic
    @Column(name = "care_con", nullable = true, length = 200)
    public String getCareCon() {
        return careCon;
    }

    public void setCareCon(String careCon) {
        this.careCon = careCon;
    }

    @Basic
    @Column(name = "cus_back", nullable = true, length = 200)
    public String getCusBack() {
        return cusBack;
    }

    public void setCusBack(String cusBack) {
        this.cusBack = cusBack;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 200)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "check_state",nullable = true,length = 200)
    public Integer getCheck() {
        return check;
    }

    public void setCheck(Integer check) {
        this.check = check;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CareRecord that = (CareRecord) o;
        return careRecId == that.careRecId &&
                Objects.equals(careTle, that.careTle) &&
                Objects.equals(beginTime, that.beginTime) &&
                Objects.equals(careCon, that.careCon) &&
                Objects.equals(cusBack, that.cusBack) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(check, that.check);
    }

    @Override
    public int hashCode() {
        return Objects.hash(careRecId, careTle, beginTime, careCon, cusBack, remark, check);
    }
}
